import React from 'react'
import { Dropdown, Menu } from 'antd';
import IconFont from '@/utils/iconFont';
import i18n from "i18next";

const I18n = () => {
    const hanldCliceNenu = ({ key }) => {
        console.log(i18n, key);
        //切换语言找i18nnext
        i18n.changeLanguage(key)
    }
    const menu = (
        <Menu
            onClick={hanldCliceNenu}
            items={[
                {
                    key: 'zh',
                    label: "英文"
                },
                {
                    key: 'en',
                    label: '中文'
                },
            ]}
        />
    );
    return (
        <div>
            <Dropdown overlay={menu}>
                <IconFont type='icon-a-zhongyingwenzhongwen' />
            </Dropdown>
        </div>
    )
}

export default I18n